package com.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author 王伟羽
 * @date 2024/11/4 18:07
 */
@Getter
@AllArgsConstructor
public enum ErrorStatusEnum {

    WZC(102,"用户未注册"),
    YJY(103,"用户已被禁用");

    private Integer code;

    private String describe;

    public static String getDescribe(Integer value) {
        for (ErrorStatusEnum p : ErrorStatusEnum.values()) {
            if (p.getCode().equals(value)) {
                return p.describe;
            }
        }
        return null;
    }

    public static Integer getValue(String describe) {
        for (ErrorStatusEnum p : ErrorStatusEnum.values()) {
            if (p.getDescribe().equals(describe)) {
                return p.getCode();
            }
        }
        return null;
    }
}
